1 module d_rss.mrss;
2 import std.c.time;
3 
4 /* mRss - Copyright (C) 2005-2007 bakunin - Andrea Marchesini 
5  *                                    <bakunin@autistici.org>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  * 
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  * 
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20  */
21 
22 /**
23 	Translation to the D Programming language by Laeeth Isharc 2015
24 	https://github.com/Laeeth/d_rss
25 */
26 
27 enum LIBMRSS_VERSION_STRING ="0.19.2";
28 enum LIBMRSS_MAJOR_VERSION =0;
29 enum LIBMRSS_MINOR_VERSION =19;
30 enum LIBMRSS_MICRO_VERSION =2;
31 
32 
33 
34 extern(C):
35 
36 alias mrss_generic_t=void *;
37 
38 // from curl.h
39 
40 
41 enum CURLcode
42 {
43   CURLE_OK = 0,
44   CURLE_UNSUPPORTED_PROTOCOL,    /* 1 */
45   CURLE_FAILED_INIT,             /* 2 */
46   CURLE_URL_MALFORMAT,           /* 3 */
47   CURLE_NOT_BUILT_IN,            /* 4 - [was obsoleted in August 2007 for
48                                     7.17.0, reused in April 2011 for 7.21.5] */
49   CURLE_COULDNT_RESOLVE_PROXY,   /* 5 */
50   CURLE_COULDNT_RESOLVE_HOST,    /* 6 */
51   CURLE_COULDNT_CONNECT,         /* 7 */
52   CURLE_FTP_WEIRD_SERVER_REPLY,  /* 8 */
53   CURLE_REMOTE_ACCESS_DENIED,    /* 9 a service was denied by the server
54                                     due to lack of access - when login fails
55                                     this is not returned. */
56   CURLE_FTP_ACCEPT_FAILED,       /* 10 - [was obsoleted in April 2006 for
57                                     7.15.4, reused in Dec 2011 for 7.24.0]*/
58   CURLE_FTP_WEIRD_PASS_REPLY,    /* 11 */
59   CURLE_FTP_ACCEPT_TIMEOUT,      /* 12 - timeout occurred accepting server
60                                     [was obsoleted in August 2007 for 7.17.0,
61                                     reused in Dec 2011 for 7.24.0]*/
62   CURLE_FTP_WEIRD_PASV_REPLY,    /* 13 */
63   CURLE_FTP_WEIRD_227_FORMAT,    /* 14 */
64   CURLE_FTP_CANT_GET_HOST,       /* 15 */
65   CURLE_OBSOLETE16,              /* 16 - NOT USED */
66   CURLE_FTP_COULDNT_SET_TYPE,    /* 17 */
67   CURLE_PARTIAL_FILE,            /* 18 */
68   CURLE_FTP_COULDNT_RETR_FILE,   /* 19 */
69   CURLE_OBSOLETE20,              /* 20 - NOT USED */
70   CURLE_QUOTE_ERROR,             /* 21 - quote command failure */
71   CURLE_HTTP_RETURNED_ERROR,     /* 22 */
72   CURLE_WRITE_ERROR,             /* 23 */
73   CURLE_OBSOLETE24,              /* 24 - NOT USED */
74   CURLE_UPLOAD_FAILED,           /* 25 - failed upload "command" */
75   CURLE_READ_ERROR,              /* 26 - couldn't open/read from file */
76   CURLE_OUT_OF_MEMORY,           /* 27 */
77   /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
78            instead of a memory allocation error if CURL_DOES_CONVERSIONS
79            is defined
80   */
81   CURLE_OPERATION_TIMEDOUT,      /* 28 - the timeout time was reached */
82   CURLE_OBSOLETE29,              /* 29 - NOT USED */
83   CURLE_FTP_PORT_FAILED,         /* 30 - FTP PORT operation failed */
84   CURLE_FTP_COULDNT_USE_REST,    /* 31 - the REST command failed */
85   CURLE_OBSOLETE32,              /* 32 - NOT USED */
86   CURLE_RANGE_ERROR,             /* 33 - RANGE "command" didn't work */
87   CURLE_HTTP_POST_ERROR,         /* 34 */
88   CURLE_SSL_CONNECT_ERROR,       /* 35 - wrong when connecting with SSL */
89   CURLE_BAD_DOWNLOAD_RESUME,     /* 36 - couldn't resume download */
90   CURLE_FILE_COULDNT_READ_FILE,  /* 37 */
91   CURLE_LDAP_CANNOT_BIND,        /* 38 */
92   CURLE_LDAP_SEARCH_FAILED,      /* 39 */
93   CURLE_OBSOLETE40,              /* 40 - NOT USED */
94   CURLE_FUNCTION_NOT_FOUND,      /* 41 */
95   CURLE_ABORTED_BY_CALLBACK,     /* 42 */
96   CURLE_BAD_FUNCTION_ARGUMENT,   /* 43 */
97   CURLE_OBSOLETE44,              /* 44 - NOT USED */
98   CURLE_INTERFACE_FAILED,        /* 45 - CURLOPT_INTERFACE failed */
99   CURLE_OBSOLETE46,              /* 46 - NOT USED */
100   CURLE_TOO_MANY_REDIRECTS ,     /* 47 - catch endless re-direct loops */
101   CURLE_UNKNOWN_OPTION,          /* 48 - User specified an unknown option */
102   CURLE_TELNET_OPTION_SYNTAX ,   /* 49 - Malformed telnet option */
103   CURLE_OBSOLETE50,              /* 50 - NOT USED */
104   CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint
105                                      wasn't verified fine */
106   CURLE_GOT_NOTHING,             /* 52 - when this is a specific error */
107   CURLE_SSL_ENGINE_NOTFOUND,     /* 53 - SSL crypto engine not found */
108   CURLE_SSL_ENGINE_SETFAILED,    /* 54 - can not set SSL crypto engine as
109                                     default */
110   CURLE_SEND_ERROR,              /* 55 - failed sending network data */
111   CURLE_RECV_ERROR,              /* 56 - failure in receiving network data */
112   CURLE_OBSOLETE57,              /* 57 - NOT IN USE */
113   CURLE_SSL_CERTPROBLEM,         /* 58 - problem with the local certificate */
114   CURLE_SSL_CIPHER,              /* 59 - couldn't use specified cipher */
115   CURLE_SSL_CACERT,              /* 60 - problem with the CA cert (path?) */
116   CURLE_BAD_CONTENT_ENCODING,    /* 61 - Unrecognized/bad encoding */
117   CURLE_LDAP_INVALID_URL,        /* 62 - Invalid LDAP URL */
118   CURLE_FILESIZE_EXCEEDED,       /* 63 - Maximum file size exceeded */
119   CURLE_USE_SSL_FAILED,          /* 64 - Requested FTP SSL level failed */
120   CURLE_SEND_FAIL_REWIND,        /* 65 - Sending the data requires a rewind
121                                     that failed */
122   CURLE_SSL_ENGINE_INITFAILED,   /* 66 - failed to initialise ENGINE */
123   CURLE_LOGIN_DENIED,            /* 67 - user, password or similar was not
124                                     accepted and we failed to login */
125   CURLE_TFTP_NOTFOUND,           /* 68 - file not found on server */
126   CURLE_TFTP_PERM,               /* 69 - permission problem on server */
127   CURLE_REMOTE_DISK_FULL,        /* 70 - out of disk space on server */
128   CURLE_TFTP_ILLEGAL,            /* 71 - Illegal TFTP operation */
129   CURLE_TFTP_UNKNOWNID,          /* 72 - Unknown transfer ID */
130   CURLE_REMOTE_FILE_EXISTS,      /* 73 - File already exists */
131   CURLE_TFTP_NOSUCHUSER,         /* 74 - No such user */
132   CURLE_CONV_FAILED,             /* 75 - conversion failed */
133   CURLE_CONV_REQD,               /* 76 - caller must register conversion
134                                     callbacks using curl_easy_setopt options
135                                     CURLOPT_CONV_FROM_NETWORK_FUNCTION,
136                                     CURLOPT_CONV_TO_NETWORK_FUNCTION, and
137                                     CURLOPT_CONV_FROM_UTF8_FUNCTION */
138   CURLE_SSL_CACERT_BADFILE,      /* 77 - could not load CACERT file, missing
139                                     or wrong format */
140   CURLE_REMOTE_FILE_NOT_FOUND,   /* 78 - remote file not found */
141   CURLE_SSH,                     /* 79 - error from the SSH layer, somewhat
142                                     generic so the error message will be of
143                                     interest when this has happened */
144 
145   CURLE_SSL_SHUTDOWN_FAILED,     /* 80 - Failed to shut down the SSL
146                                     connection */
147   CURLE_AGAIN,                   /* 81 - socket is not ready for send/recv,
148                                     wait till it's ready and try again (Added
149                                     in 7.18.2) */
150   CURLE_SSL_CRL_BADFILE,         /* 82 - could not load CRL file, missing or
151                                     wrong format (Added in 7.19.0) */
152   CURLE_SSL_ISSUER_ERROR,        /* 83 - Issuer check failed.  (Added in
153                                     7.19.0) */
154   CURLE_FTP_PRET_FAILED,         /* 84 - a PRET command failed */
155   CURLE_RTSP_CSEQ_ERROR,         /* 85 - mismatch of RTSP CSeq numbers */
156   CURLE_RTSP_SESSION_ERROR,      /* 86 - mismatch of RTSP Session Ids */
157   CURLE_FTP_BAD_FILE_LIST,       /* 87 - unable to parse FTP file list */
158   CURLE_CHUNK_FAILED,            /* 88 - chunk callback reported error */
159   CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the
160                                     session will be queued */
161   CURL_LAST /* never use! */
162 } 
163 
164 
165 enum mrss_error_t
166 {
167 	MRSS_OK = 0,			/**< No error */
168 	MRSS_ERR_POSIX,		/**< For the correct error, use errno */
169 	MRSS_ERR_PARSER,		/**< Parser error */
170 	MRSS_ERR_DOWNLOAD,		/**< Download error */
171 	MRSS_ERR_VERSION,		/**< The RSS has a no compatible VERSION */
172 	MRSS_ERR_DATA			/**< The parameters are incorrect */
173 }
174 
175 enum mrss_version_t
176 {
177 	MRSS_VERSION_0_91,		/**< 0.91 RSS version */
178 	MRSS_VERSION_0_92,		/**< 0.92 RSS version */
179 	MRSS_VERSION_1_0,		/**< 1.0 RSS version */
180 	MRSS_VERSION_2_0,		/**< 2.0 RSS version */
181 	MRSS_VERSION_ATOM_0_3,	/**< 0.3 Atom version */
182 	MRSS_VERSION_ATOM_1_0		/**< 1.0 Atom version */
183 } 
184 
185 enum mrss_flag_t
186 {
187 	MRSS_FLAG_VERSION = 1,
188 
189 	/** Set the title to a mrss_t element - the value is a string */
190 	MRSS_FLAG_TITLE,
191 	/** Set the title type to a mrss_t element - the value is a string (ex: text, html, ...)*/
192 	MRSS_FLAG_TITLE_TYPE,
193 	/** Set the description to a mrss_t element - the value is a string */
194 	MRSS_FLAG_DESCRIPTION,
195 	/** Set the description type to a mrss_t element - the value is a string */
196 	MRSS_FLAG_DESCRIPTION_TYPE,
197 	/** Set the link to a mrss_t element - the value is a string */
198 	MRSS_FLAG_LINK,
199 	/** Set the id to a mrss_t element - the value is a string */
200 	MRSS_FLAG_ID,
201 	/** Set the language to a mrss_t element - the value is a string */
202 	MRSS_FLAG_LANGUAGE,
203 	/** Set the rating to a mrss_t element - the value is a string */
204 	MRSS_FLAG_RATING,
205 	/** Set the copyright to a mrss_t element - the value is a string */
206 	MRSS_FLAG_COPYRIGHT,
207 	/** Set the copyright type to a mrss_t element - the value is a string */
208 	MRSS_FLAG_COPYRIGHT_TYPE,
209 	/** Set the pubDate to a mrss_t element - the value is a string */
210 	MRSS_FLAG_PUBDATE,
211 	/** Set the lastBuildDate to a mrss_t element - the value is a string */
212 	MRSS_FLAG_LASTBUILDDATE,
213 	/** Set the docs to a mrss_t element - the value is a string */
214 	MRSS_FLAG_DOCS,
215 	/** Set the managingeditor to a mrss_t element - the value is a string */
216 	MRSS_FLAG_MANAGINGEDITOR,
217 	/** Set the managingeditor's email to a mrss_t element - the value is a string */
218 	MRSS_FLAG_MANAGINGEDITOR_EMAIL,
219 	/** Set the managingeditor's uri to a mrss_t element - the value is a string */
220 	MRSS_FLAG_MANAGINGEDITOR_URI,
221 	/** Set the webMaster to a mrss_t element - the value is a string */
222 	MRSS_FLAG_WEBMASTER,
223 	/** Set the generator to a mrss_t element - the value is a string */
224 	MRSS_FLAG_TTL,
225 	/** Set the about to a mrss_t element - the value is a string */
226 	MRSS_FLAG_ABOUT,
227 
228 	/* Contributor */
229 
230 	/** Set the contributor to a mrss_t element - the value is a string */
231 	MRSS_FLAG_CONTRIBUTOR,
232 	/** Set the contributor's email to a mrss_t element - the value is a string */
233 	MRSS_FLAG_CONTRIBUTOR_EMAIL,
234 	/** Set the contributor's uri to a mrss_t element - the value is a string */
235 	MRSS_FLAG_CONTRIBUTOR_URI,
236 
237 	/* Generator */
238 
239 	/** Set the generator to a mrss_t element - the value is a string */
240 	MRSS_FLAG_GENERATOR,
241 	/** Set the generator's email to a mrss_t element - the value is a string */
242 	MRSS_FLAG_GENERATOR_URI,
243 	/** Set the generator's uri to a mrss_t element - the value is a string */
244 	MRSS_FLAG_GENERATOR_VERSION,
245 
246 	/* Image */
247 
248 	/** Set the image_title to a mrss_t element - the value is a string */
249 	MRSS_FLAG_IMAGE_TITLE,
250 	/** Set the image_url to a mrss_t element - the value is a string */
251 	MRSS_FLAG_IMAGE_URL,
252 	/** Set the image_logo to a mrss_t element - the value is a string */
253 	MRSS_FLAG_IMAGE_LOGO,
254 	/** Set the image_link to a mrss_t element - the value is a string */
255 	MRSS_FLAG_IMAGE_LINK,
256 	/** Set the image_width to a mrss_t element - the value is a integer */
257 	MRSS_FLAG_IMAGE_WIDTH,
258 	/** Set the image_height to a mrss_t element - the value is a integer */
259 	MRSS_FLAG_IMAGE_HEIGHT,
260 	/** Set the image_description to a mrss_t element - the value is a string */
261 	MRSS_FLAG_IMAGE_DESCRIPTION,
262 
263 	/* TextInput */
264 
265 	/** Set the textinput_title to a mrss_t element - the value is a string */
266 	MRSS_FLAG_TEXTINPUT_TITLE,
267 	/** Set the textinput_description to a mrss_t element - the value is a string */
268 	MRSS_FLAG_TEXTINPUT_DESCRIPTION,
269 	/** Set the textinput_name to a mrss_t element - the value is a string */
270 	MRSS_FLAG_TEXTINPUT_NAME,
271 	/** Set the textinput_link to a mrss_t element - the value is a string */
272 	MRSS_FLAG_TEXTINPUT_LINK,
273 
274 	/* Cloud */
275 
276 	/** Set the cloud to a mrss_t element - the value is a string */
277 	MRSS_FLAG_CLOUD,
278 	/** Set the cloud_domain to a mrss_t element - the value is a string */
279 	MRSS_FLAG_CLOUD_DOMAIN,
280 	/** Set the cloud_port to a mrss_t element - the value is a string */
281 	MRSS_FLAG_CLOUD_PORT,
282 	/** Set the cloud_path to a mrss_t element - the value is a integer */
283 	MRSS_FLAG_CLOUD_PATH,
284 	/** Set the cloud_registerProcedure to a mrss_t element - 
285 	* the value is a string */
286 	MRSS_FLAG_CLOUD_REGISTERPROCEDURE,
287 	/** Set the cloud_protocol to a mrss_t element - the value is a string */
288 	MRSS_FLAG_CLOUD_PROTOCOL,
289 
290 	/* SkipHours */
291 
292 	/** Set the hour to a mrss_hour_t element - the value is a string */
293 	MRSS_FLAG_HOUR,
294 
295 	/* SkipDays */
296 
297 	/** Set the day to a mrss_day_t element - the value is a string */
298 	MRSS_FLAG_DAY,
299 
300 	/* Category or Item/Category */
301 
302 	/** Set the category to a mrss_category_t element - the value is a string */
303 	MRSS_FLAG_CATEGORY,
304 	/** Set the domain to a mrss_category_t element - the value is a string */
305 	MRSS_FLAG_CATEGORY_DOMAIN,
306 	/** Set the label to a mrss_category_t element - the value is a string */
307 	MRSS_FLAG_CATEGORY_LABEL,
308 
309 	/* Item */
310 
311 	/** Set the title to a mrss_item_t element - the value is a string */
312 	MRSS_FLAG_ITEM_TITLE,
313 	/** Set the title type to a mrss_item_t element - the value is a string */
314 	MRSS_FLAG_ITEM_TITLE_TYPE,
315 	/** Set the link to a mrss_item_t element - the value is a string */
316 	MRSS_FLAG_ITEM_LINK,
317 	/** Set the description to a mrss_item_t element - the value is a string */
318 	MRSS_FLAG_ITEM_DESCRIPTION,
319 	/** Set the description type to a mrss_item_t element - the value is a string */
320 	MRSS_FLAG_ITEM_DESCRIPTION_TYPE,
321 	/** Set the copyright to a mrss_item_t element - the value is a string */
322 	MRSS_FLAG_ITEM_COPYRIGHT,
323 	/** Set the copyright type to a mrss_item_t element - the value is a string */
324 	MRSS_FLAG_ITEM_COPYRIGHT_TYPE,
325 
326 	/** Set the author to a mrss_item_t element - the value is a string */
327 	MRSS_FLAG_ITEM_AUTHOR,
328 	/** Set the author's uri to a mrss_item_t element - the value is a string */
329 	MRSS_FLAG_ITEM_AUTHOR_URI,
330 	/** Set the author's email to a mrss_item_t element - the value is a string */
331 	MRSS_FLAG_ITEM_AUTHOR_EMAIL,
332 
333 	/** Set the contributor to a mrss_item_t element - the value is a string */
334 	MRSS_FLAG_ITEM_CONTRIBUTOR,
335 	/** Set the contributor's uri to a mrss_item_t element - the value is a string */
336 	MRSS_FLAG_ITEM_CONTRIBUTOR_URI,
337 	/** Set the contributor's email to a mrss_item_t element - the value is a string */
338 	MRSS_FLAG_ITEM_CONTRIBUTOR_EMAIL,
339 
340 	/** Set the comments to a mrss_item_t element - the value is a string */
341 	MRSS_FLAG_ITEM_COMMENTS,
342 	/** Set the pubDate to a mrss_item_t element - the value is a string */
343 	MRSS_FLAG_ITEM_PUBDATE,
344 	/** Set the guid to a mrss_item_t element - the value is a string */
345 	MRSS_FLAG_ITEM_GUID,
346 	/** Set the guid_isPermaLink to a mrss_item_t element - 
347 	* the value is a integer */
348 	MRSS_FLAG_ITEM_GUID_ISPERMALINK,
349 	/** Set the source to a mrss_item_t element - the value is a string */
350 	MRSS_FLAG_ITEM_SOURCE,
351 	/** Set the source_url to a mrss_item_t element - the value is a string */
352 	MRSS_FLAG_ITEM_SOURCE_URL,
353 	/** Set the enclosure to a mrss_item_t element - the value is a string */
354 	MRSS_FLAG_ITEM_ENCLOSURE,
355 	/** Set the enclosure_url to a mrss_item_t element - the value is a string */
356 	MRSS_FLAG_ITEM_ENCLOSURE_URL,
357 	/** Set the enclosure_length to a mrss_item_t element - 
358 	* the value is a integer */
359 	MRSS_FLAG_ITEM_ENCLOSURE_LENGTH,
360 	/** Set the enclosure_type to a mrss_item_t element - the value is a string */
361 	MRSS_FLAG_ITEM_ENCLOSURE_TYPE,
362 
363 	/* Item */
364 
365 	/** Set the name to a mrss_tag_t element - the value is a string */
366 	MRSS_FLAG_TAG_NAME,
367 
368 	/** Set the value to a mrss_tag_t element - the value is a string */
369 	MRSS_FLAG_TAG_VALUE,
370 
371 	/** Set the namespace to a mrss_tag_t element - the value is a string */
372 	MRSS_FLAG_TAG_NS,
373 
374 	/** Set the name to a mrss_attribute_t element - the value is a string */
375 	MRSS_FLAG_ATTRIBUTE_NAME,
376 
377 	/** Set the value to a mrss_attribute_t element - the value is a string */
378 	MRSS_FLAG_ATTRIBUTE_VALUE,
379 
380 	/** Set the namespace to a mrss_attribute_t element - the value is a string */
381 	MRSS_FLAG_ATTRIBUTE_NS,
382 
383 	/** Set the terminetor flag */
384 	MRSS_FLAG_END = 0
385 } 
386 
387 enum mrss_element_t
388 {
389  MRSS_ELEMENT_CHANNEL,
390  MRSS_ELEMENT_ITEM,
391  MRSS_ELEMENT_SKIPHOURS,
392  MRSS_ELEMENT_SKIPDAYS,
393  MRSS_ELEMENT_CATEGORY,
394  MRSS_ELEMENT_TAG,
395  MRSS_ELEMENT_ATTRIBUTE
396 }
397 
398 struct mrss_item_t {
399 	mrss_element_t element;
400 	int allocated;
401 	char *title;			/* R	O	O	O	R	*/
402 	char *title_type;		/* -	-	-	-	O	*/
403 	char *link;			/* R	O	O	O	O	*/
404 	char *description;		/* R	O	-	O	O	*/
405 	char *description_type;	/* -	-	-	-	0	*/
406 	char *copyright;		/* -	-	-	-	O	*/
407 	char *copyright_type;		/* -	-	-	-	O	*/
408 
409 	char *author;			/* -	-	-	O	O	*/
410 	char *author_uri;		/* -	-	-	-	O	*/
411 	char *author_email;		/* -	-	-	-	O	*/
412 
413 	char *contributor;		/* -	-	-	-	O	*/
414 	char *contributor_uri;	/* -	-	-	-	O	*/
415 	char *contributor_email;	/* -	-	-	-	O	*/
416 
417 	char *comments;		/* -	-	-	O	-	*/
418 	char *pubDate;		/* -	-	-	O	O	*/
419 	char *guid;			/* -	-	-	O	O	*/
420 	int guid_isPermaLink;		/* -	-	-	O	-	*/
421 
422 	char *source;			/* -	O	-	O	-	*/
423 	char *source_url;		/* -	R	-	R	-	*/
424 
425 	char *enclosure;		/* -	O	-	O	-	*/
426 	char *enclosure_url;		/* -	R	-	R	-	*/
427 	int enclosure_length;		/* -	R	-	R	-	*/
428 	char *enclosure_type;		/* -	R	-	R	-	*/
429 
430 	mrss_category_t *category;	/* -	O	-	O	O	*/
431 
432 	mrss_tag_t *other_tags;
433 
434 	mrss_item_t *next;
435 }
436 
437 struct mrss_hour_t {
438 	mrss_element_t element;
439 	int allocated;
440 
441 	char *hour;			/* R	R	-	R	-	*/
442 	mrss_hour_t *next;
443 }
444 
445 struct mrss_day_t {
446 	/** For internal use only: */
447 	mrss_element_t element;
448 	int allocated;
449 
450 	/* Data: */
451 					/* 0.91	0.92	1.0	2.0	ATOM	*/
452 	char *day;			/* R	R	-	R	-	*/
453 	mrss_day_t *next;
454 }
455 
456 struct mrss_category_t {
457 	mrss_element_t element;
458 	int allocated;
459 	char *category;		/* -	R	-	R	R	*/
460 	char *domain;			/* -	O	-	O	O	*/
461 	char *label;			/* -	-	-	-	O	*/
462 	mrss_category_t *next;
463 }
464 
465 struct mrss_t {
466 	mrss_element_t element;
467 	int allocated;
468 	int curl_error;
469 	char *file;
470 	size_t size;
471 	char *encoding;
472 	mrss_version_t _version;
473 	char *title;			/* R	R	R	R	R	*/
474 	char *title_type;		/* -	-	-	-	O	*/
475 	char *description;		/* R	R	R	R	R	*/
476 	char *description_type;	/* -	-	-	-	O	*/
477 	char *link;			/* R	R	R	R	O	*/
478 	char *id;			/* 	-	-	-	-	O	*/
479 	char *language;		/* R	O	-	O	O	*/
480 	char *rating;			/* O	O	-	O	-	*/
481 	char *copyright;		/* O	O	-	O	O	*/
482 	char *copyright_type;		/* -	-	-	-	O	*/
483 	char *pubDate;		/* O	O	-	O	-	*/
484 	char *lastBuildDate;		/* O	O	-	O	O	*/
485 	char *docs;			/* O	O	-	O	-	*/
486 	char *managingeditor;		/* O	O	-	O	O	*/
487 	char *managingeditor_email;	/* O	O	-	O	O	*/
488 	char *managingeditor_uri;	/* O	O	-	O	O	*/
489 	char *webMaster;		/* O	O	-	O	-	*/
490 	int ttl;			/* -	-	-	O	-	*/
491 	char *about;			/* -	-	R	-	-	*/
492 	char *contributor;		/* -	-	-	-	R	*/
493 	char *contributor_email;	/* -	-	-	-	O	*/
494 	char *contributor_uri;	/* -	-	-	-	O	*/
495 	char *generator;		/* -	-	-	O	O	*/
496 	char *generator_uri;		/* -	-	-	-	O	*/
497 	char *generator_version;	/* -	-	-	-	O	*/
498 	char *image_title;		/* R	R	R	R	-	*/
499 	char *image_url;		/* R	R	R	R	O	*/
500 	char *image_logo;		/* -	-	-	-	O	*/
501 	char *image_link;		/* R	R	R	R	-	*/
502 	uint image_width;	/* O	O	-	O	-	*/
503 	uint image_height;	/* O	O	-	O	-	*/
504 	char *image_description;	/* O	O	-	O	-	*/
505 
506 	/* TextInput: */		/* O	O	O	O	-	*/
507 	char *textinput_title;	/* R	R	R	R	-	*/
508 	char *textinput_description;	/* R	R	R	R	-	*/
509 	char *textinput_name;		/* R	R	R	R	-	*/
510 	char *textinput_link;		/* R	R	R	R	-	*/
511 
512 	/* Cloud */
513 	char *cloud;			/* -	O	-	O	-	*/
514 	char *cloud_domain;		/* -	R	-	R	-	*/
515 	int cloud_port;		/* -	R	-	R	-	*/
516 	char *cloud_path;		/* -	R	-	R	-	*/
517 	char *cloud_registerProcedure;/* -	R	-	R	-	*/
518 	char *cloud_protocol;		/* -	R	-	R	-	*/
519 
520 	mrss_hour_t *skipHours;	/* O	O	-	O	-	*/
521 	mrss_day_t *skipDays;		/* O	O	-	O	-	*/
522 
523 	mrss_category_t *category;	/* -	O	-	O	O	*/
524 
525 	mrss_item_t *item;		/* R	R	R	R	R	*/
526 
527 	mrss_tag_t *other_tags;
528 
529 	version(USE_LOCALE)
530 		void *c_locale;
531 }
532 
533 struct mrss_tag_t {
534 	/** For internal use only: */
535 	mrss_element_t element;
536 	int allocated;
537 
538 	/*name of the tag */
539 	char *name;
540 
541 	/* value */
542 	char *value;
543 
544 	/* namespace */
545 	char *ns;
546 
547 	/* list of attributes: */
548 	mrss_attribute_t *attributes;
549 
550 	/* Sub tags: */
551 	mrss_tag_t *children;
552 
553 	/* the next tag: */
554 	mrss_tag_t *next;
555 };
556 
557 struct mrss_attribute_t {
558 	/** For internal use only: */
559 	mrss_element_t element;
560 	int allocated;
561 
562 	/* name of the tag */
563 	char *name;
564 
565 	/* value */
566 	char *value;
567 
568 	/* namespace */
569 	char *ns;
570 
571 	/* The next attribute: */
572 	mrss_attribute_t *next;
573 }
574 struct mrss_options_t
575 {
576 	int timeout;
577 	char *proxy;
578 	char *proxy_authentication;
579 	char *certfile;
580 	char *cacert;
581 	char *password;
582 	int verifypeer;
583 	char *authentication;
584 	char *user_agent;
585 }
586 
587 mrss_error_t	mrss_parse_url		(char *		url, mrss_t **	mrss);
588 mrss_error_t	mrss_parse_url_with_options (char *		url, mrss_t **	mrss, mrss_options_t	* options);
589 mrss_error_t	mrss_parse_url_with_options_and_error (char *		url, mrss_t **	mrss, mrss_options_t	* options, CURLcode *	curlcode);
590 mrss_error_t	mrss_parse_url_with_options_error_and_transfer_buffer (char *		url, mrss_t **	mrss, mrss_options_t	* options, CURLcode *	curlcode, char **	feed_content, int *		feed_size);
591 mrss_error_t	mrss_parse_file		(char *		file, mrss_t **	mrss); mrss_error_t	mrss_parse_buffer	(char *		buffer, size_t		size_buffer, mrss_t **	mrss);
592 mrss_error_t	mrss_write_file		(mrss_t *	mrss,char* file);
593 mrss_error_t	mrss_write_buffer	(mrss_t *	mrss, char **	buffer);
594 mrss_error_t	mrss_free		(mrss_generic_t	element);
595 char *		mrss_strerror		(mrss_error_t	err);
596 char *		mrss_curl_strerror	(CURLcode	err);
597 mrss_error_t	mrss_element		(mrss_generic_t	element, mrss_element_t *ret);
598 mrss_error_t	mrss_get_last_modified(char *		urlstring, time_t *	lastmodified);
599 
600 mrss_error_t	mrss_get_last_modified_with_options (char *		urlstring, time_t *	lastmodified, mrss_options_t * options);
601 mrss_error_t	mrss_get_last_modified_with_options_and_error
602 					(char *		urlstring,
603 					 time_t *	lastmodified,
604 					 mrss_options_t * options,
605 					 CURLcode *	curl_code);
606 mrss_error_t	mrss_new		(mrss_t **	mrss);
607 mrss_error_t	mrss_set		(mrss_generic_t	element,
608 					 ...);
609 mrss_error_t	mrss_get		(mrss_generic_t	element,
610 					 ...);
611 mrss_error_t	mrss_new_subdata	(mrss_generic_t	element,
612 					 mrss_element_t	subelement,
613 					 mrss_generic_t	subdata);
614 mrss_error_t	mrss_remove_subdata	(mrss_generic_t	element,
615 					 mrss_generic_t	subdata);
616 mrss_error_t	mrss_search_tag		(mrss_generic_t	element, char *		name, char *		ns, mrss_tag_t **	tag);
617 mrss_error_t	mrss_search_attribute	(mrss_generic_t	element, char *		name, char *		ns,
618 					 mrss_attribute_t ** attribute);
619 mrss_options_t * mrss_options_new	(int timeout, char *proxy, char *proxy_authentication, char *certfile, char *password,
620 					 char *cacert, int verifypeer, char *authentication, char *user_agent);
621 void		mrss_options_free	(mrss_options_t *options);
622